package org.helgoboss.mintty

import java.io.File
import org.helgoboss.scala_additions.currentRichRuntime
import org.helgoboss.terminal.Terminal
import sys.process._

class Mintty(val exeFile: File, val configFile: Option[File]) extends Terminal {

    def open(innerCommandComponents: Seq[String], keepOpen: Boolean = false, windowTitle: Option[String] = None) {
        val minttyBaseCmd = new MinttyCommand(exeFile = exeFile, configFile = configFile, keepOpen = keepOpen, windowTitle = windowTitle)
        val completeCmdComponents = minttyBaseCmd.components ++ innerCommandComponents
        completeCmdComponents.run
    }
}